package com.yuanbao.controller;

import com.yuanbao.api.base.user.UserApi;
import com.yuanbao.base.response.Message;
import com.yuanbao.common.controller.BaseController;
import com.yuanbao.mapper.PaperMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/business")
@Slf4j
@CrossOrigin
public class BusinessController extends BaseController {

    @Value("${huawei.address}")
    private String tt;

    @Autowired
    private UserApi userApi;
    @Autowired
    private PaperMapper paperMapper;

    @GetMapping("/info")
    public String getUserInfo() {
        Long count = paperMapper.selectCount(null);
        log.debug("business info");
        Message<String> info = userApi.info("business");
        return "Response from business Service" + info.getData();
    }
}
